#region using statements

using AeonOfStrife.States;

using NGen;
using NGen.Managers.Audio;
using NGen.Managers.Collision;
using NGen.Managers.GUI;
using NGen.Managers.GameObject;
using NGen.Managers.GameState;
using NGen.Managers.Input;
using NGen.Managers.Pathfinding;

#endregion

namespace AeonOfStrife
{
#if WINDOWS || XBOX
	internal static class Program
	{
		/// <summary>
		/// 	The main entry point for the application.
		/// </summary>
		private static void Main(string[] args) {
			using(var game = new GameEngine()) {
				game.IsMouseVisible = true;

				GameEngine.GraphicsDeviceManager.PreferredBackBufferWidth = 1440;
				GameEngine.GraphicsDeviceManager.PreferredBackBufferHeight = 900;

				SetupManagers();

				GameEngine.GetService<IManagerGameState>().StartingState = new GameStateMenu();
				game.Run();
			}
		}

		/// <summary>
		/// 	Creates the managers, registers them as services, adds them to the
		/// 	game engine to be automatically updated
		/// </summary>
		private static void SetupManagers() {
			GameEngine.GameServices.AddService(typeof(IManagerGameState), new ManagerGameState());
			GameEngine.AddManager(GameEngine.GetService<IManagerGameState>());
			GameEngine.GameServices.AddService(typeof(IManagerAudio2D), new ManagerAudio2D());
			GameEngine.AddManager(GameEngine.GetService<IManagerAudio2D>());
			GameEngine.GameServices.AddService(typeof(IManagerGameObjects), new ManagerGameObjects());
			GameEngine.AddManager(GameEngine.GetService<IManagerGameObjects>());
			GameEngine.GameServices.AddService(typeof(IManagerGUI), new ManagerGUI());
			GameEngine.AddManager(GameEngine.GetService<IManagerGUI>());
			GameEngine.GameServices.AddService(typeof(IManagerInput), new ManagerInput());
			GameEngine.AddManager(GameEngine.GetService<IManagerInput>());
			GameEngine.GameServices.AddService(typeof(IManagerCollision2D), new ManagerCollision2D());
			GameEngine.AddManager(GameEngine.GetService<IManagerCollision2D>());
			GameEngine.GameServices.AddService(typeof(IManagerPathfinding), new ManagerPathfinding());
		}
	}
#endif
}